import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'
import First from '../views/first/first.vue'
import Follow from '../views/follow/follow.vue'
import videoList from '../views/first/components/videoList.vue'
import city from '../views/first/components/city.vue'
import changeCity from '../views/changeCity/changeCity.vue'
import followList from '../views/follow/components/followList.vue'
import news from '../views/news/news.vue'
import personal from '../views/personal/personal.vue'
import workList from '../views/personal/components/workList.vue'
import player from '../views/player/player.vue'
import user from '../views/user/user.vue'

Vue.use(VueRouter)

const routes = [{
    path: '/',
    name: 'Home',
    component: Home,
    children: [{
        path: '/',
        name: 'First',
        component: First,
        children: [{
            path: '/',
            name: 'videoList',
            component: videoList,
          },
          {
            path: 'city',
            name: 'city',
            component: city,
          }
        ]
      },
      {
        path: 'follow',
        name: 'Follow',
        component: Follow,
        children: [{
            path: '/',
            name: 'followList',
            component: followList,
          },
          {
            path: '/friend',
            name: 'friend',
            component: followList,
          }
        ]
      },
      {
        path: 'news',
        name: 'news',
        component: news
      },
      {
        path: 'personal',
        name: 'personal',
        component: personal,
        children:[
          {
            path:'/',
            name:'workList',
            component:workList
          },
          {
            path:'/followList',
            name:'followList',
            component:workList
          },
          {
            path:'/likeList',
            name:'likeList',
            component:workList
          }
          
          
        ]
      }
    ]
  },
  {
    path: '/changeCity',
    name: 'changeCity',
    component: changeCity,
  },
  {
    path: '/player',
    name: 'player',
    component: player,
  },
  {
    path: '/user',
    name: 'user',
    component: user,
    children:[
      {
        path:'/',
        name:'personals',
        component:personal,
        children:[
          {
            path:'/',
            name:'workList',
            component:workList
          },
          {
            path:'/followListUser',
            name:'followListUser',
            component:workList
          },
          {
            path:'/likeListUser',
            name:'likeListUser',
            component:workList
          }
          
          
        ]
      }
    ]
  }

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
